function z = legendre(n)
	
	% calcul coeficientilor unui polinom Legendre de grad n

	y=[1 0];   %L1(x)=x
        x=1;
	if n == 0
  		z = x;
	elseif n == 1
  		x = 1;     %L0(x)=1
  		z = y;
	else
 		 for k=2:n
   			z = [ ( 2*k - 1 ) / k * y  0] -[ 0  0 ( k - 1 ) / k * x ];
     	 		x=y;
     	 		y=z;
   		 endfor
        endif
endfunction

